package io.datajek.springbasics.movierecommendersystem.lesson12;

import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
@Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE,proxyMode = ScopedProxyMode.TARGET_CLASS)
public class Movie {
    public static int instance=0;
    private String name;
    private String genre;
    private  String producer;
    private Logger logger= LoggerFactory.getLogger(this.getClass());

    public Movie() {
        super();
       logger.info("In Movie constructor method");

    }
    @PostConstruct
    public void postConstruct(){
        logger.info("In Movie postConstruct method");

    }
    @PreDestroy
    public void PreDestroy(){
        logger.info("In Movie preDestroy method");
    }
    public static int getInstance(){
        return instance;
    }
}




